package org.ssm.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.ssm.dao.EbookMapper;
import org.ssm.pojo.Ebook;
import org.ssm.service.EbookService;

import javax.annotation.Resource;
import java.util.List;


@Service("ebookService")
public class EbookServiceImpl implements EbookService {

    @Resource
    EbookMapper ebookMapper;

    @Override
    public int save(Ebook ebook) {
        return ebookMapper.save(ebook);
    }

    @Override
    public int update(Ebook ebook) {
        return ebookMapper.update(ebook);
    }

    @Override
    public Ebook getOneEbook(int id) {
        return ebookMapper.getOneEbook(id);
    }

    @Override
    public int getRecordCount(Ebook ebook) {
        return ebookMapper.getRecordCount(ebook);
    }

    @Override
    public List<Ebook> getEbookListByPage(Ebook ebook) {
        return ebookMapper.getEbookListByPage(ebook);
    }

    @Override
    public List<Ebook> getTopEbookList() {
        return ebookMapper.getTopEbookList();
    }

    @Override
    public int delete(int id) {
        return ebookMapper.delete(id);
    }

    @Override
    public int deleteAll(String[] ids) {
        return ebookMapper.deleteAll(ids);
    }
}
